<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html  style="background:linear-gradient(to bottom,#fff, #ddd,#fff)">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <style>
        input[type=password]{
            border: 1px #999 solid;
            height: 30px;
            border-radius: 5px;
            padding-left: 5px;
        }

        input[type=submit]{
            border: 1px #31b0d5 solid;
            background-color: #31b0d5;
            width: 90px;
            height: 42px;
            color: #fff;
            font-weight:bold;
            border-radius: 5px;
        }
    </style>
</head>
<body>
<h2 style="text-align: center;">修改密码</h2>
<p style="text-align: center;color:red;">${error}</p>

    <form action="${pageContext.request.contextPath}/dati/modifyPsd" method="post" onsubmit="return eqPsd()">

        <table  cellspacing="0px" cellpadding="10px" align="center">

            <tr>
                <td>旧密码</td>
                <td><input name="oldpsd" type="password" placeholder="请输入旧密码" size="30" required></td>
            </tr>

            <tr>
                <td>新密码</td>
                <td><input name="newpsd" id="newpsd" type="password" placeholder="请输入新密码" maxlength="20"  size="30" required></td>
            </tr>

            <tr>
                <td>确认密码</td>
                <td><input name="newpsd2" id="newpsd2" type="password" placeholder="请确认新密码" maxlength="20"  size="30" required></td>
            </tr>

            <tr>
                <td colspan="2" align="center"> <input type="submit" value="确认修改"/> </td>
            </tr>

        </table>
    </form>
</div>
</body>

<script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
<script>
    function eqPsd() {
        var psd1 = $("#newpsd").val();
        var psd2 = $("#newpsd2").val();

        if(psd1 == psd2){
            return true;
        }else{
            alert("两次密码输入不一致");
            return false;
        }
    }
</script>
</html>